<?php
if (!defined('FosfoaSystem')) {
    exit(1);
}
class linkModel extends spModel
{
    var $pk = "link_id"; // 每个唯一的标志，可以称为主键
    var $table = "link"; // 数据表的名称
    function Detail($link_id)
    {
        $condition = array('link_id' => $link_id);
        $arr = $this->find($condition);
        return $arr;
    }
    /**
     * 切换图列表
     */
    function get_link_list($num)
    {
        $condition = 'link_type=0';
        $arr = $this->spCache(3600 * 24)->findAll($condition, 'sort desc,link_id desc', null,
            $num);
        return $arr;
    }
    /**
     * 根据类别显示不同链接
     */
    function get_link_type($type)
    {
        $condition = 'link_type='.$type;
        $arr = $this->spCache(3600 * 24)->findAll($condition, 'sort desc,link_id desc');
        return $arr;
    }
}